package com.wsj.message_server.config;

import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * <p>功能: </p>
 *
 * <p>描述: </p>
 *
 * @author 王大神
 * @date 2018年8月8日
 */
@Configuration
public class MyBatisConfiguration {

    /**
     * 注册MyBaits分页插件PageHelper
     *
     * @return
     */
    @Bean
    public PageHelper pageHelper() {
        Properties properties = new Properties();
        properties.setProperty("offsetAsPageNum", "true");
        properties.setProperty("rowBoundsWithCount", "true");
        properties.setProperty("reasonable", "false");
        PageHelper pageHelper = new PageHelper();
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
